﻿<WPFTaskbarNotifier:TaskbarNotifier x:Class="HudsonMonitor.Notify.ExampleTaskbarNotifier" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:WPFTaskbarNotifier="clr-namespace:WPFTaskbarNotifier" xmlns:Notify="clr-namespace:HudsonMonitor.Notify" Title="Hudson Build Monitor" Height="160" Width="300" x:Name="ThisControl">
	<Window.Background>
		<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
			<GradientStop Color="#FF999999" Offset="1" />
			<GradientStop Color="White" />
		</LinearGradientBrush>
	</Window.Background>
	<WPFTaskbarNotifier:TaskbarNotifier.Resources>

		<DataTemplate x:Key="ItemsTemplate">
			<Grid>
				<Grid.RowDefinitions>
					<RowDefinition Height="Auto" />
				</Grid.RowDefinitions>
				<Grid.ColumnDefinitions>
					<ColumnDefinition Width="*" />
				</Grid.ColumnDefinitions>
				<StackPanel Grid.Column="0" Margin="0,5,0,0" VerticalAlignment="Top" Orientation="Vertical">
					<TextBlock Text="{Binding Path=Title}" FontWeight="Bold" />
					<Label Grid.Column="1" Margin="0,-1,0,0" HorizontalAlignment="Left" ToolTip="Click to open">
						<Hyperlink Click="ItemClick" Tag="{Binding}">
							<TextBlock Text="{Binding Path=Message}" TextWrapping="Wrap" />
						</Hyperlink>
					</Label>
				</StackPanel>
			</Grid>
		</DataTemplate>

	</WPFTaskbarNotifier:TaskbarNotifier.Resources>

	<Border BorderThickness="1" BorderBrush="#fff1efe2">
		<Border BorderThickness="1" BorderBrush="#ffffffff">
			<Border BorderThickness="1" BorderBrush="#ffd4d0c8">
				<Grid Margin="1">
					<Grid.RowDefinitions>
						<RowDefinition Height="45" />
						<RowDefinition Height="5" />
						<RowDefinition Height="*" />
						<RowDefinition Height="5" />
					</Grid.RowDefinitions>

					<Label Grid.Row="0" Margin="8,0,8,0" FontSize="25" FontWeight="Bold" Content="Build message..." Foreground="#FF77AAE4">
						<Label.Effect>
							<DropShadowEffect ShadowDepth="4" />
						</Label.Effect>
					</Label>

					<Button Grid.Row="0" HorizontalAlignment="Right" VerticalAlignment="Top" Width="15" Height="15" Click="HideButtonClick">
						<Button.ToolTip>Hide</Button.ToolTip>
						<Image>
							<Image.Source>
								<DrawingImage>
									<DrawingImage.Drawing>
										<GeometryDrawing>
											<GeometryDrawing.Pen>
												<Pen Brush="Black" Thickness="3" />
											</GeometryDrawing.Pen>
											<GeometryDrawing.Geometry>
												<GeometryGroup>
													<LineGeometry StartPoint="0,0" EndPoint="20,20" />
													<LineGeometry StartPoint="20,0" EndPoint="0,20" />
												</GeometryGroup>
											</GeometryDrawing.Geometry>
										</GeometryDrawing>
									</DrawingImage.Drawing>
								</DrawingImage>
							</Image.Source>
						</Image>
					</Button>

					<Path Grid.Row="3" Stretch="Fill" Margin="0,0,0,0" VerticalAlignment="Top" Height="1" Data="M0,64 L608,64">
						<Path.Stroke>
							<LinearGradientBrush EndPoint="1,0.5" StartPoint="0,0.5" MappingMode="RelativeToBoundingBox" SpreadMethod="Repeat">
								<GradientStop Color="#FF77AAE4" Offset="0" />
								<GradientStop Color="White" Offset="1" />
							</LinearGradientBrush>
						</Path.Stroke>
					</Path>

					<ScrollViewer Grid.Row="2" VerticalScrollBarVisibility="Auto">
						<ItemsControl Name="ItemsList" BorderThickness="0" ItemsSource="{Binding ElementName=ThisControl, Path=NotifyContent}" ItemTemplate="{StaticResource ItemsTemplate}">
							<ItemsControl.ItemsPanel>
								<ItemsPanelTemplate>
									<StackPanel Orientation="Vertical" Width="Auto" />
								</ItemsPanelTemplate>
							</ItemsControl.ItemsPanel>
						</ItemsControl>
					</ScrollViewer>

					<Path Grid.Row="1" Stretch="Fill" Margin="0,0,0,0" VerticalAlignment="Top" Height="1" Data="M0,64 L608,64">
						<Path.Stroke>
							<LinearGradientBrush EndPoint="1,0.5" StartPoint="0,0.5" MappingMode="RelativeToBoundingBox" SpreadMethod="Repeat">
								<GradientStop Color="#FF77AAE4" Offset="0" />
								<GradientStop Color="White" Offset="1" />
							</LinearGradientBrush>
						</Path.Stroke>
					</Path>

				</Grid>

			</Border>
		</Border>
	</Border>
</WPFTaskbarNotifier:TaskbarNotifier>